<%@ Page Language="C#" MasterPageFile="~/Views/Shared/BasicSite.Master" Inherits="QianJin.Views.Home" %>

<asp:Content ID="Content2" ContentPlaceHolderID="FullMainContent" runat="server">
    <table width="980" border="0" align="center" cellpadding="0" cellspacing="0" class="index_product_title">
        <tr>
            <td width="487" class="title_a">
                &nbsp;&nbsp;<a href="<%=this.Url.Action("Show", "ProductList", new {categoryId = "{00000000-0000-0000-0000-000000000000}"}) %>"><%=GetString("home_latestproducts") %></a>
            </td>
            <td width="493" align="right">
                <a href="<%=this.Url.Action("Show", "ProductList") %>">
                    <strong><%=GetString("home_moreproducts") %>&gt;&gt;</strong></a>&nbsp;&nbsp;
            </td>
        </tr>
    </table>
    <table width="980" border="0" align="center" cellpadding="0" cellspacing="0" class="index_product_bg">
        <tr>
            <td align="center">
                <table width="96%" border="0" cellspacing="0" cellpadding="0">
                    <tr>
                        <%foreach (var prod in this.Model.LatestProducts)
                          { %>
                        <td width="16%" align="center">
                            <table width="140" border="0" cellspacing="0" cellpadding="0" class="border_all">
                                <tr>
                                    <td height="105" align="center">
                                        <a href="<%=this.Url.Action("ShowProduct", "ProductList", new {prodId = prod.id, categoryId = this.Model.CurrentCategory.id}) %>">
                                        <img style="border:none;" src="<%=QianJin.Views.ViewUtility.GetProductImageUrl(prod.id) %>" width="140"
                                            height="105" />
                                            </a>
                                    </td>
                                </tr>
                            </table>
                            <table width="142" border="0" cellspacing="0" cellpadding="0" class="border_title">
                                <tr>
                                    <td height="27" align="center">
                                        <a href="<%=this.Url.Action("ShowProduct", "ProductList", new {prodId = prod.id, categoryId = this.Model.CurrentCategory.id}) %>">
                                            <%=prod.Name%></a>
                                    </td>
                                </tr>
                            </table>
                        </td>
                        <%} %>
                        <%for (int i = 0; i < 6 - this.Model.LatestProducts.Length; i++)
                          {%>
                        <td width="16%" align="center"></td>
                        <%} %>
                    </tr>
                </table>
            </td>
        </tr>
    </table>
    <table width="980" border="0" align="center" cellpadding="0" cellspacing="0" class="index_product_bottom">
        <tr>
            <td>
            </td>
        </tr>
    </table>
    <table width="980" border="0" align="center" cellpadding="0" cellspacing="0">
        <tr>
            <td>
                &nbsp;
            </td>
        </tr>
    </table>
    <table width="980" border="0" align="center" cellpadding="0" cellspacing="0">
        <tr>
            <td width="700" align="left" valign="top">
                <table width="680" border="0" cellspacing="0" cellpadding="0" class="all_bgcolor">
                    <tr>
                        <td align="center" valign="top">
                            <table width="660" border="0" cellspacing="0" cellpadding="0">
                                <tr>
                                    <td height="40">
                                        <div class="title_left">
                                            <div class="title_left_01">
                                            </div>
                                            <div class="title_left_02">
                                                <%=GetString("home_product")%></div>
                                            <div class="title_left_03">
                                            </div>
                                            <div class="title_left_04">
                                                <%=GetString("home_category") %></div>
                                        </div>
                                    </td>
                                </tr>
                            </table>
                            <table width="660" border="0" cellspacing="0" cellpadding="0">
                                <tr>
                                    <td valign="top" bgcolor="#FFFFFF">
                                        <table width="200" border="0" align="center" cellpadding="0" cellspacing="0">
                                            <tr>
                                                <td>
                                                    &nbsp;
                                                </td>
                                            </tr>
                                        </table>
                                        <table width="93%" border="0" align="center" cellpadding="0" cellspacing="0">
                                            <%
                                                int totalTrCount = this.Model.Categories.Length == 0 ? 0 : (this.Model.Categories.Length - 1) / 4 + 1;
                                                int categoryIndex = 0;
                                                for (int i = 0; i < totalTrCount; i++)
                                                {
                                            %>
                                            <tr>
                                                <% for (int j = 0; j < 4; j++, categoryIndex++)
                                                   {%>
                                                <%if (categoryIndex < this.Model.Categories.Length)
                                                  {
                                                      var category = this.Model.Categories[categoryIndex];
                                                %>
                                                <td height="25" align="left">
                                                    <img src="/content/left_nav_ico.jpg" width="11" height="12" />
                                                    <a href="<%=this.Url.Action("show", "ProductList", new { categoryId=category.id }) %>">
                                                        <%= category.Name%></a>
                                                </td>
                                                <%}
                                                  else
                                                  { %>
                                                <td height="25" align="left">
                                                </td>
                                                <%} %>
                                                <%}%>
                                            </tr>
                                            <%}%>
                                        </table>
                                        <table width="200" border="0" align="center" cellpadding="0" cellspacing="0">
                                            <tr>
                                                <td>
                                                    &nbsp;
                                                </td>
                                            </tr>
                                        </table>
                                    </td>
                                </tr>
                            </table>
                            <table width="220" border="0" cellspacing="0" cellpadding="0">
                                <tr>
                                    <td>
                                        &nbsp;
                                    </td>
                                </tr>
                            </table>
                        </td>
                    </tr>
                </table>
                <table width="680" border="0" cellspacing="0" cellpadding="0">
                    <tr>
                        <td>
                            &nbsp;
                        </td>
                    </tr>
                </table>
                <table width="680" border="0" cellspacing="0" cellpadding="0" class="all_bgcolor">
                    <tr>
                        <td align="center" valign="top">
                            <table width="660" border="0" cellspacing="0" cellpadding="0">
                                <tr>
                                    <td height="40">
                                        <div class="title_left">
                                            <div class="title_left_01">
                                            </div>
                                            <div class="title_left_02">
                                                <%=GetString("home_order")%></div>
                                            <div class="title_left_03">
                                            </div>
                                            <div class="title_left_04">
                                                <%=GetString("home_flow")%></div>
                                        </div>
                                    </td>
                                </tr>
                            </table>
                            <table width="660" border="0" cellspacing="0" cellpadding="0">
                                <tr>
                                    <td valign="top" bgcolor="#FFFFFF">
                                        <table width="200" border="0" align="center" cellpadding="0" cellspacing="0">
                                            <tr>
                                                <td>
                                                    &nbsp;
                                                </td>
                                            </tr>
                                        </table>
                                        <table border="0" align="center" cellpadding="0" cellspacing="0">
                                            <tr>
                                                <td>
                                                    <img src="<%= QianJin.Views.ViewUtility.MapImagePath("index_flow.jpg")%>" width="613"
                                                        height="57" />
                                                </td>
                                            </tr>
                                        </table>
                                        <table width="200" border="0" align="center" cellpadding="0" cellspacing="0">
                                            <tr>
                                                <td>
                                                    &nbsp;
                                                </td>
                                            </tr>
                                        </table>
                                    </td>
                                </tr>
                            </table>
                            <table width="220" border="0" cellspacing="0" cellpadding="0">
                                <tr>
                                    <td>
                                        &nbsp;
                                    </td>
                                </tr>
                            </table>
                        </td>
                    </tr>
                </table>
            </td>
            <td width="280" align="right" valign="top">
                <table width="280" border="0" cellspacing="0" cellpadding="0" class="all_bgcolor">
                    <tr>
                        <td align="center" valign="top">
                            <table width="260" border="0" cellspacing="0" cellpadding="0">
                                <tr>
                                    <td height="40">
                                        <div class="title_left">
                                            <div class="title_left_01">
                                            </div>
                                            <div class="title_left_02">
                                                <%=GetString("home_contact")%></div>
                                            <div class="title_left_03">
                                            </div>
                                            <div class="title_left_04">
                                                <%=GetString("home_us")%></div>
                                        </div>
                                    </td>
                                </tr>
                            </table>
                            <table width="260" border="0" cellspacing="0" cellpadding="0">
                                <tr>
                                    <td valign="top" bgcolor="#FFFFFF">
                                        <table width="200" border="0" align="center" cellpadding="0" cellspacing="0">
                                            <tr>
                                                <td>
                                                    &nbsp;
                                                </td>
                                            </tr>
                                        </table>
                                        <table width="200" border="0" align="center" cellpadding="0" cellspacing="0">
                                            <tr>
                                                <td>
                                                    <img src="/content/index_right_img.jpg" width="247" height="77" />
                                                </td>
                                            </tr>
                                        </table>
                                        <table width="200" border="0" align="center" cellpadding="0" cellspacing="0">
                                            <tr>
                                                <td>
                                                    &nbsp;
                                                </td>
                                            </tr>
                                        </table>
                                        <table width="235" border="0" align="center" cellpadding="0" cellspacing="0" class="index_contacts">
                                            <tr>
                                                <td align="left">
                                                    <%=GetString("home_address") %><br />
                                                    <%=GetString("home_postcode") %><br />
                                                    <%=GetString("home_phone") %><br />
                                                    <%=GetString("home_fax") %><br />
                                                    <%=GetString("home_website") %><br />
                                                    <%=GetString("home_email") %>
                                                </td>
                                            </tr>
                                        </table>
                                        <table width="200" border="0" align="center" cellpadding="0" cellspacing="0">
                                            <tr>
                                                <td>
                                                    &nbsp;
                                                </td>
                                            </tr>
                                        </table>
                                    </td>
                                </tr>
                            </table>
                            <table width="220" border="0" cellspacing="0" cellpadding="0">
                                <tr>
                                    <td>
                                        &nbsp;
                                    </td>
                                </tr>
                            </table>
                        </td>
                    </tr>
                </table>
            </td>
        </tr>
    </table>
</asp:Content>
